home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / biz / swood / FW_MEf.lha / FW_MEf / MEinfügen_V3.fwrexx.long < prev    next >
Text File  |  1998-01-28  |  5KB  |  229 lines

  1. /* ============================================ */
  2. /* Final Writer Arexx Macro - Mehrfach Einfügen */
  3. /* by Heiko Schröder (Age)                      */
  4. /* $VER: Mehrfach Einfügen 1.65(28.01.98) für V3*/
  5. /* ============================================ */
  6. R='0A'X
  7. Dre=0
  8. Sei=0
  9.  
  10. Address='FinalW'
  11. Options results
  12.  
  13. STATUS PORTNAME
  14. FW = result
  15. address(FW)
  16.  
  17. SIGNAL ON BREAK_C
  18. SIGNAL ON SYNTAX
  19.  
  20. 'ShowMessage 1 0 "Mehrfach Einfügen V1.65 - 28.01.98" "Neu: Das FW Makro-Paket V3" "Info im Mehrfach-Einfügen-Guide" "Weiter" "Abbruch" ""'
  21. If result=2 then Exit
  22.  
  23. GetDocItemPrefs Decimal
  24. Punkt=Result
  25. If Punkt="Comma" then DocItemPrefs Decimal Period
  26.  
  27. GraphicTool
  28. Ungroup
  29. nr=1
  30. CurrentObject
  31. ObjectId = Result
  32. IF ObjectId=0 THEN do
  33.    'ShowMessage 1 1 "Fehler:" "Kein Grafikobjekt ausgewählt..." "" "Abbruch" "" ""'
  34.    Call BREAK_C
  35. End
  36.  
  37. /*Kontrolle ob ein oder mehrere Objekte ausgewählt sind*/
  38.  
  39. Objekt.0=nr; Objekt.nr=ObjectID
  40. FirstObject Selected
  41. ID=result
  42. Call Zaehlen
  43. Do While 1
  44.    NextObject ID Selected
  45.    ID=result
  46.    If ID=0 then Leave
  47.    Call Zaehlen
  48. End
  49.  
  50. If Objekt.0=1 then do
  51.    gruppe=false
  52. end
  53. else gruppe=true
  54.  
  55. /*Ende der Kontrolle*/
  56.  
  57. STATUS View
  58. Zoom=result
  59.  
  60. STATUS Pages
  61. Seiten=result
  62.  
  63. STATUS Page
  64. Seite=result
  65. kx=9999
  66. ky=9999
  67. If Gruppe=true then
  68.    Do a=1 to Objekt.0
  69.    GetObjectCoords Objekt.a
  70.    Parse var result Soite ax ay rest
  71.    if ax<kx then kx=ax
  72.    if ay<ky then ky=ay
  73. end
  74.  
  75. Do a=2 to Objekt.0
  76.    SelectObject Objekt.a MULTIPLE
  77. End
  78. SelectObject Objekt.1 MULTIPLE
  79.  
  80. If Gruppe=true then Group
  81.  
  82. Copy
  83. IF RC=0 THEN do
  84.    CurrentObject
  85.    ObjectID=result
  86.    GetObjectCoords ObjectID
  87.    Parse var result Seite x y w h
  88.    wl=w
  89.    hl=h
  90.    if Gruppe=true then do
  91.       x=kx; y=ky
  92.    End
  93.    GetObjectRotation ObjectID
  94.    Dreh=result
  95.    GetObjectType ObjectID
  96.    Typ=result
  97.  
  98.    If Gruppe=true then Group
  99.  
  100.    'ShowMessage 2 0 "Wie soll die Bildschirmausgabe erfolgen?" "" "" "Normal" "Schnell" ""'
  101.    ba=result
  102.  
  103.    Do While 1
  104.       Result="ß"
  105.       RequestText '"Mehrfach Einfügen" "Anzahl der Kopien" ""'
  106.       Anzahl=Result
  107.       If Anzahl="ß" then call BREAK_C
  108.       If Anzahl=""|Anzahl=0 then call Ende
  109.       If Datatype(Anzahl,'W')=1 then leave
  110.             else call oops
  111.    End
  112.  
  113.    Do while 1
  114.       Result="ß"
  115.       RequestText '"Mehrfach Einfügen" "Horizontale Verschiebung in cm" ""'
  116.       Hor=Result
  117.       If Hor="ß" then call BREAK_C
  118.       If Hor="" then Hor=0
  119.       If Datatype(Hor,'N')=1 then leave
  120.             else call oops1
  121.    End
  122.  
  123.    Do while 1
  124.       Result="ß"
  125.       RequestText '"Mehrfach Einfügen" "Vertikale Verschiebung in cm" ""'
  126.       Ver=Result
  127.       If Ver="ß" then call BREAK_C
  128.       If Ver="" then Ver=0
  129.       If Datatype(Ver,'N')=1 then leave
  130.             else call oops1
  131.    End
  132.  
  133.    Do while 1
  134.       Result="ß"
  135.       RequestText '"Mehrfach Einfügen" "Drehung in Grad" ""'
  136.       Dre=Result
  137.       If Dre="ß" then call BREAK_C
  138.       If Dre="" then Dre=0
  139.       If Datatype(Dre,'W')=1 then leave
  140.          else call oops
  141.    End
  142.  
  143.    Do While 1
  144.       Result="ß"
  145.       RequestText '"Mehrfach Einfügen" "Auf welche Seite? 0=dieselbe Seite" ""'
  146.       Sei=Result
  147.       If Sei="ß" then call BREAK_C
  148.       If Sei=""|Sei=0 then Sei=Seite
  149.       If Datatype(Sei,'W')=1 then leave
  150.          else call oops
  151.    End
  152.  
  153.    If ba=2 then View 400
  154.  
  155.    Do a=1 to (Sei-Seiten)
  156.       InsertPageBreak
  157.    End
  158.       
  159.    Do i=1 TO Anzahl
  160.       Paste
  161.       CurrentObject
  162.       ObjectID=Result
  163.       a=x+(Hor*i)
  164.       b=y+(Ver*i)
  165.       Winkel=Dreh+Dre*i
  166.  
  167.       If Typ=2|Typ=3 then do                     /*Linien*/
  168.          GetPageSetup HEIGHT
  169.          Pagehoehe=result
  170.          w=wl+(Hor*i)
  171.          h=hl+(Ver*i)
  172.          If Sei~=1 then h=h+(sei-1)*Pagehoehe
  173.       End
  174.       SetObjectCoords ObjectID Sei a b w h
  175.       SetObjectRotation ObjectID Winkel
  176.       If Gruppe=true then Group
  177.    End
  178. End
  179. If Sei~=Seite then GotoPage Sei
  180.  
  181. Call WH
  182. Redraw
  183. 'ShowMessage 1 1 "Vielen Dank für die Benutzung." "© Heiko Schröder" "http://yi.com/home/SchroederHeiko" "Klick" "" ""'
  184. Exit
  185.  
  186. ENDE:
  187.    Call WH
  188.    'ShowMessage 1 1 "Falsche Anzahl an Kopien..." "" "" "Abbruch" "" ""'
  189.    EXIT
  190.  
  191. SYNTAX:
  192.    Call WH
  193.    'ShowMessage 1 1 "Es ist ein Fehler aufgetreten." "Nähere Info in Datei «Ram:Fehler«" "" "Was?" "Gibts nicht!" "Sofort melden"'
  194.    address "REXX"
  195.    Open("F","Ram:Fehler","W")
  196.    writeln("F","ACHTUNG! FW_MEf V1.65 Makro-Fehler"||R)
  197.    writeln("F",'Fehler in Zeile' SIGL ':' ERRORTEXT(RC)||R)
  198.    writeln("F", 'Bitte informieren Sie den Autor unter age@thepentagon.com')
  199.    Close("F")
  200. EXIT
  201.  
  202. BREAK_C:
  203.    Call WH
  204.    'ShowMessage 1 1 "Sie haben abgebrochen..." "© Heiko Schröder" "http://yi.com/home/SchroederHeiko" "Okay" "" ""'
  205.    EXIT
  206.  
  207. WH:
  208.    If ba=2 then do
  209.       View Zoom
  210.       GoToPage Sei
  211.    End
  212.    If Punkt="Comma" then DocItemPrefs DECIMAL Comma
  213. Return
  214.  
  215. Zaehlen:
  216. If ID~=Objekt.1 then do
  217.    nr=nr+1
  218.    Objekt.0=nr; Objekt.nr=ID
  219. End
  220. Return
  221.  
  222. oops:
  223. 'ShowMessage 1 1 "Falsche Eingabe!" "Bitte ganzzahlige Eingabe!" "" "Okay" "" ""'
  224. return
  225.  
  226. oops1:
  227. 'ShowMessage 1 1 "Falsche Eingabe!" "Bitte numerische Eingabe mit (.) !" "" "Okay" "" ""'
  228. return
  229.